<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/template.xhtml"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	>
	<ui:define name="content">
		<ui:include src="/includes/menu.xhtml"></ui:include>
	
		<h1><h:outputText value="Můj Profil" /></h1>
		
		<ui:include src="/includes/menuTierTwo.xhtml"></ui:include>
	
		<h2><h:outputText value="Fragmenty" /></h2>
		<h:outputText value="Administrace fragmentů:" />
	
		<h:form>
		<rich:dataTable value="#{fragmentAdministrationBean.fragments}" var="fragment">
			<rich:column>
				<f:facet name="header">
					<h:outputText value="id" />
				</f:facet>			
				<h:outputText value="#{fragment.id}" />
			</rich:column>	
			<rich:column>
				<f:facet name="header">
					<h:outputText value="event" />
				</f:facet>	
				<h:outputText value="#{fragment.title}" />
			</rich:column>	
			<rich:column>
				<f:facet name="header">
					<h:outputText value="description" />
				</f:facet>	
				<h:outputText value="#{fragment.description}" />
			</rich:column>		
			<rich:column>
				<f:facet name="header">
					<h:outputText value="delete" />
				</f:facet>	
				<h:form>
					<a4j:commandButton value="delete" action="#{fragmentAdministrationBean.deleteFragment(fragment.id)}" />
				</h:form>
			</rich:column>	
		</rich:dataTable>
		</h:form>
		
		<h:outputLink value="#{request.contextPath}/view/admin/create-fragment.jsf">Nový fragment</h:outputLink>
	</ui:define>
</ui:composition>